//
//  YUDockView.m
//  QQZone
//
//  Created by 张洪毓 on 15/11/24.
//  Copyright © 2015年 张洪毓. All rights reserved.
//

#import "YUDockView.h"
#import "YUIconView.h"
#import "YUTabbarView.h"
#import "YUBottomViw.h"

@interface YUDockView ()
@property (nonatomic,strong) YUBottomViw *bottomView;
@property (nonatomic,strong) YUTabbarView *tabbarView;
@property (nonatomic,strong) YUIconView *iconView;
@end

@implementation YUDockView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        YUIconView *icon = [[YUIconView alloc] init];
//        icon.backgroundColor = [UIColor redColor];
        [self addSubview:icon];
        self.iconView = icon;
        
        YUTabbarView *tabbar = [[YUTabbarView alloc] init];
        tabbar.backgroundColor = [UIColor orangeColor];
        [self addSubview:tabbar];
        self.tabbarView = tabbar;
        tabbar.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
        
        YUBottomViw *bottom = [[YUBottomViw alloc] init];
        bottom.backgroundColor = [UIColor lightGrayColor];
        self.bottomView = bottom;
        [self addSubview:bottom];
        bottom.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
    }
    
    return self;
}

-(void)setIsLandscape:(BOOL)isLandscape{
    
    _isLandscape = isLandscape;
    self.bottomView.isLandscape = isLandscape;
    self.bottomView.y = self.height - self.bottomView.height;
    self.width = self.bottomView.width;
    
    self.tabbarView.isLandscape = isLandscape;
    self.tabbarView.y = self.bottomView.y - self.tabbarView.height;
    self.tabbarView.width = self.width;
    
    
    self.iconView.isLandscape = isLandscape;
}






@end
